/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.service.impl;

import cc.altius.dao.AmbulanceDao;
import cc.altius.model.Ambulance;
import cc.altius.model.AmbulanceSer;
import cc.altius.service.AmbulanceService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author sagar
 */
@Service
public class AmbulanceSeviceImpl implements AmbulanceService {

    @Autowired
    private AmbulanceDao ambulanceDao;

    @Override
    public int addAmbulance(Ambulance ambulance) {
        return this.ambulanceDao.addAmbulance(ambulance);
    }

    @Override
    public int updateAmbulance(Ambulance ambulance, int ambulanceId) {
        return this.ambulanceDao.updateAmbulance(ambulance, ambulanceId);
    }

    @Override
    public List<Ambulance> getAmbulanceList() {
        return this.ambulanceDao.getAmbulanceList();
    }

    @Override
    public Ambulance getAmbulanceById(int ambulanceId) {
        return this.ambulanceDao.getAmbulanceById(ambulanceId);
    }
    
    @Override
    public Ambulance getAmbulanceByCompanyName(String companyName) {
        return this.ambulanceDao.getAmbulanceByCompanyName(companyName);
    }

    @Override
    public boolean existAmbulanceByCompanyName(String companyName) {
        if (this.ambulanceDao.getAmbulanceByCompanyName(companyName)==null) {
            return false;
        } else {
            return true;
        }
    }

   
}
